package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.NewsPlateDao;
import com.cn.wanxi.dao.impl.NewsPlateImpl;
import com.cn.wanxi.model.PlateModel;
import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.INewsPlateService;

import java.util.List;

public class NewsPlateServiceImpl implements INewsPlateService {
    @Override
    public List<PlateModel> findAll() {
        NewsPlateDao newsPlateDao = new NewsPlateImpl();
        List<PlateModel> list=newsPlateDao.findAll();
        return list;
    }

    @Override
    public ResultModel add(PlateModel plateModel) {
        ResultModel resultModel = new ResultModel();
        NewsPlateDao newsPlateDao = new NewsPlateImpl();
        resultModel.setResult(newsPlateDao.add(plateModel) == 1 ? "新增成功" : "新增失败");
        return resultModel;
    }
}
